package com.ls.controller.example.model;

import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

import javax.validation.constraints.Max;
import javax.validation.constraints.Min;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import java.util.List;

/**
 * @ClassName EditExampleModel
 * @Description 编辑示例model
 * @Author pengyu
 * @Date 2024/6/27 17:14
 * @Version 1.0
 **/
@Data
@NoArgsConstructor
@AllArgsConstructor
@Builder
public class EditExampleModel {
    @NotNull(message = "示例id不得为空")
    private Long exampleId;
    /**
     * 0首页轮播下面的提示文字,1为挂机短信，2为智能关怀，3为预定管理
     */
    @NotNull(message = "类型不得为空")
    @Max(value = 3)
    @Min(value = 0)
    private Integer type;
    /**示例字段*/
    private List<EditExampleModel.info> list;
    @Data
    public static class info {
        /**
         * 1照片，2视频，3文字
         */
        @NotNull(message = "字段类型不得为空")
        @Max(value = 3)
        @Min(value = 1)
        private Integer type;
        /**
         * 字段内容
         */
        @NotBlank(message = "字段内容不得为空")
        private String content;
        /**
         * 类型3 时有效，代表滚动速度
         */
        private Integer seconds;
        /**字段排序*/
        @NotNull(message = "字段排序不得为空")
        private Integer fieldIndex;
    }
}
